package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.db.domain.system.PcCard;
import com.ruoyi.db.mapper.system.PcCardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.service.IPcCardService;

import javax.transaction.Transactional;

/**
 * 银藻道具卡Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-05
 */
@Service
@Transactional(rollbackOn = Exception.class)
public class PcCardServiceImpl implements IPcCardService 
{
    @Autowired
    private PcCardMapper pcCardMapper;

    /**
     * 查询银藻道具卡
     * 
     * @param id 银藻道具卡主键
     * @return 银藻道具卡
     */
    @Override
    public PcCard selectPcCardById(Long id)
    {
        return pcCardMapper.selectPcCardById(id);
    }

    /**
     * 查询银藻道具卡列表
     * 
     * @param pcCard 银藻道具卡
     * @return 银藻道具卡
     */
    @Override
    public List<PcCard> selectPcCardList(PcCard pcCard)
    {
        return pcCardMapper.selectPcCardList(pcCard);
    }

    /**
     * 新增银藻道具卡
     * 
     * @param pcCard 银藻道具卡
     * @return 结果
     */
    @Override
    public int insertPcCard(PcCard pcCard)
    {
        pcCard.setSellStatus(1l);
        pcCard.setIsDelete(0);
        pcCard.setCreateTime(new Date());
        return pcCardMapper.insertPcCard(pcCard);
    }

    /**
     * 修改银藻道具卡
     * 
     * @param pcCard 银藻道具卡
     * @return 结果
     */
    @Override
    public int updatePcCard(PcCard pcCard)
    {
        return pcCardMapper.updatePcCard(pcCard);
    }

    /**
     * 批量删除银藻道具卡
     * 
     * @param ids 需要删除的银藻道具卡主键
     * @return 结果
     */
    @Override
    public int deletePcCardByIds(Long[] ids)
    {
        return pcCardMapper.deletePcCardByIds(ids);
    }

    /**
     * 删除银藻道具卡信息
     * 
     * @param id 银藻道具卡主键
     * @return 结果
     */
    @Override
    public int deletePcCardById(Long id)
    {
        return pcCardMapper.deletePcCardById(id);
    }
}
